<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/27 0027
 * Time: 17:03
 */
namespace app\home\controller;
use think\Controller;
use think\Db;

class Base  extends  Controller
{

    public function _initialize(){
        if(request()->isMobile()){
            header("Location:/wap.php");
            die;
        }

        $pp_link = Db::name('brand')->where('is_show=1 and sign="pc"')->value('out_link');
        $this->assign('pp_link',$pp_link);
        $this->assign('data_ext',getCompany());
        $data_sys = Db::name('company')->where('sign="pc"')->find();
        $this->assign('data_sys',$data_sys);
        
        //自助报价
        $data_zzbj = Db::name('zzbj')->where('sign="pc" and is_del=0')
                 ->order('id desc')
                ->limit(1)
                ->find();
        $this->assign('data_zzbj',$data_zzbj);
        //品牌世界
        $data_brand_nav = Db::name('banner')->where('is_show=1 and sign="pc"and  class_id=48')->limit(1)->find();
    
         $this->assign('data_brand_nav',$data_brand_nav);
         
          //风格样片
        $data_brand_fg = Db::name('banner')->where('is_show=1 and sign="pc"and  class_id=49')->limit(1)->find();
    
         $this->assign('data_brand_fg',$data_brand_fg);
         
            //客片大赏
        $data_brand_kp = Db::name('banner')->where('is_show=1 and sign="pc"and  class_id=50')->limit(1)->find();
    
         $this->assign('data_brand_kp',$data_brand_kp);
         
            //明星服装
        $data_brand_mx = Db::name('banner')->where('is_show=1 and sign="pc"and  class_id=51')->limit(1)->find();
    
         $this->assign('data_brand_mx',$data_brand_mx);
         
         
        
    }

    
    
    public function publicIndex() {
        
 /**
 * Created by PhpStorm.
 * User: yuanbin
 * Date: 2018/10/13 
 *mote:查询  样片风格
 * Time: 11.18
 */
         //二级导航栏拍摄风格
                     
             $data_nav_two = Db::name('style')->where('is_show=1 and sign="pc" and type = "2"')->order('sort desc,id desc')->select();
            $this->assign('data_nav_two',$data_nav_two);
            
               //二级导航栏最新发布
                     
             $zxfb_nav_two = Db::name('style')->where('is_show=1 and sign="pc" and type = "3"')->order('sort desc,id desc')->select();
            $this->assign('zxfb_nav_two',$zxfb_nav_two);
            
            //二级导航客片大赏
                     
             $kp_nav_two = Db::name('worksclass')->select();
            $this->assign('kp_nav_two',$kp_nav_two);
            
              //城市选择
                     
             $cs_nav_two = Db::name('cs')->select();
            $this->assign('cs_nav_two',$cs_nav_two);
            
             $data_brand_ps = Db::name('zzbj')->order('id desc')->limit(1)->find();
    
         $this->assign('data_brand_ps',$data_brand_ps);
    }
    
}



